home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / gensmall.zip / VARFUNS.EXP < prev   
Text File  |  1993-01-04  |  3KB  |  75 lines

  1. ***************************************************************
  2. ** This is a modification to the VARFUNS.TLB.  Another parameter
  3. ** was added, "surr_quot," which places the correct quotation
  4. ** marks around a split string which will then be passed by the
  5. ** calling routine as a parameter surrounded by quotes.
  6. **
  7. ** "surr_quot" is a parameter passed as ".t." if the calling function
  8. ** has quotation marks around the string to be built.  This will
  9. ** make sure that the quotation marks are correct for Clipper.
  10. **
  11. ** Modification 1) Line 18 - additional parameter
  12. ** Modification 2) Lines 46 through 51 Code to handle the
  13. **                 Quotation marks if required.
  14. ** (John McCarvel 6-13-89)
  15. ***************************************************************
  16. ***************************************************************
  17. function build_row_display_xpr
  18. param b, absrow, surr_quot
  19.  
  20. private xpr             ** we'll build the expression in here
  21. private transv          ** substring holder
  22. private c, abscol       ** column runners (relative & absolute)
  23. private r               ** row number relative to the box
  24. private txt             ** holds vtrans(field)  rev#5
  25. private xprlen          ** current length of expression from previous linefeed rev #5
  26. private outl            ** 1 if outline box else 0 rev #5
  27.  
  28. r = absrow - b.top      ** adjust the row number
  29. xpr = ""
  30. xprlen = 0                                                  ** rev #5
  31. outl = iif(b.outline.type,1,0)                              ** rev #5
  32. c = outl
  33. abscol = b.left + c
  34.  
  35. for all fields where field.owner = b .and. field.row = absrow
  36.   if field.col - abscol > 0
  37.     txt = digest_text(box_text(b, r, c, field.col-abscol))
  38.     xpr = xpr + "+" + txt                                   ** rev #5
  39.     xprlen = xprlen + len(txt) + 1                          ** rev #5
  40.   endif
  41.  
  42.   txt = vtrans(field)                                       ** rev #5
  43.   xprlen = xprlen + len(txt) + 1 ** Add 1 for "+" concatenation ** rev #5
  44.   if xprlen > 75        ** Line is getting full, needs a line continuation
  45.      ** Clipper cannot continue inside a string             ** rev #5
  46.      if pcount() > 2 .and. surr_quot = .t.                  ** rev #5  *JM
  47.         ** Called from within a quote.                                 *JM
  48.         xpr = xpr + "'+;%n'+" + txt                         ** rev #5  *JM
  49.      else                                                              *JM
  50.         xpr = xpr + " +;%n " + txt                          ** rev #5  *JM
  51.      endif                                                             *JM
  52.      xprlen = len(txt)                                      ** rev #5
  53.   else
  54.      xpr = xpr + "+" + txt
  55.   endif
  56.   abscol = field.col + disp_len(field)
  57.   c = abscol - b.left
  58. endfor
  59.  
  60. ** some text or space betw. last field and right edge of box
  61. if abscol <= b.right - outl
  62.   xpr = xpr + "+" + ;
  63.     digest_text(box_text(b, r, c, b.right-outl-abscol+1))
  64. endif
  65.  
  66. ** turn any single quotes into doubles. Sort of a sleaze, to allow
  67. ** calling function to double-quote returned string unconditionally.
  68. strtran(xpr, "'", '"')
  69.  
  70. ** return it -- also remove leading '+' from above
  71. return xpr[2..len(xpr)]
  72.  
  73. **************************************************************************
  74. *
  75.